<?php

namespace App\Http\Controllers\Home;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use DB;

class DetailController extends Controller
{
    //点赞
    public function del()
    {
    	$id = $_GET['data'];
    	$res = DB::table('image') -> where('id',$id) -> increment('count',1);
    	if($res == 1)
    	{
    		return 1;
    	}else{
    		return 2;
    	}
    }

    public function detail($id)
    {
        $data = DB::table('image') -> where('id',$id) ->first();
        return view('home.detail',['data' => $data]);
    }
}
